<?php
//---------------------------------------------------------------------------------------------------------------------------
    require_once('../../../config.inc.php');
    //---------------------------------------------------------------------------------------------------
    include_once($config['app_dir'] . '/includes/column.class.php');
    include_once($config['app_dir'] . '/includes/pager.class.php');
    include_once($config['app_dir'] . '/includes/session.class.php');
    include_once($config['app_dir'] . '/includes/FormParams.class.php');
    include_once($config['app_dir'] . '/classes/admins/const/const.const.php');
    include_once($config['app_dir'] . '/classes/admins/sql/const.sql.php');
    require_once($config['app_dir'] . '/classes/staff.class.php');

    $Staff = new objStaff($config['app_id']);
    if( 3!=$Staff->UserGroupID() ) die('You have not permission to see this page. ');//var_dump($Staff->UserGroupID());
    //-----------------------------------------------------------------------------------------------------------------------
    // delete record
    //-------------------------------------------------------------------------------------------------------
    $DataBase = objDataBase::GetInstance();
    $ParamsDelete = new objFormParams('get', 'const_');
    if( !$ParamsDelete->isEmpty() && $params_delete = $ParamsDelete->getAssocArray() )
        if( 'delete' == $params_delete['operation']) {
            $DataBase->Execute('DELETE FROM fa_const WHERE id=' . $params_delete['id']);
    }
    //-------------------------------------------------------------------------------------------------------
    // Pager
    //-------------------------------------------------------------------------------------------------------
    $Pager = new objRsGridPager($ConstColumnSet, $const_query_main, $const_query_count, 'const');
    $Pager->rows_steps = array(20);
    $Pager->edit_script ='const.php';
    $Pager->new_script ='const.php';
    $Pager->delete_script ='consts.php';
    $Pager->setTitle($ConstColumnSet->title);
    //---------------------------------------------------------------------------------
	$Page = new objTemplate();
    $Page->Assign('content',$Pager->Render('admins/lang/grid_simple.tpl'));
	$Page->Display('admins/lang/page_lang.tpl');
//---------------------------------------------------------------------------------------------------------------------------
?>
